import static org.junit.Assert.assertEquals;

import org.junit.Before;
import org.junit.Test;


/**
 * 
 */

/**
 * @author Trefzger
 *
 */
public class LoadFileTest {
	/**
	 * Module Name:
	 * Description:
	 * Calling Sequence
	 * 		Input Parameters
	 * 		Output Parameters
	 * Error Conditions Tested:
	 * Error Messages Generated:
	 * Original Author:
	 * Procedure Creation Date:
	 * Modification Log:
	 * 	 Who/When/Why
	 * Coding Standards Met: "Signed Code Leader(Jaron)"
	 * Testing Standards Met: "Signed Test Leader(Jamie)"
	 */
	@Before
	public void setUp() throws Exception {
		LoadFile.resetLoadFile();
		LoadFile.startLoadFile("junitTest", 4, 40, 0);
		LoadFile.addTextRecord(8, "instructionCode", "instructionModule");
		LoadFile.addTextRecord(10, "instructionCode2", "instructionModule2");
		LoadFile.addTextRecord(12, "instructionCode3", "instructionModule3");	
	}
	@Test
	public void moduleNameTest(){
		String value = LoadFile.returnModuleName();
		assertEquals("Should be junitTest", "junitTest", value);
	}
	@Test
	public void initialLoadAddressTest(){
		Integer value = LoadFile.returnInitialLoadAddress();
		assertEquals(0, 0, value);
	}
	@Test
	public void loadAddressTest(){
		Integer value = LoadFile.returnLoadAddress();
		assertEquals(0, 0, value);
	}
	@Test
	public void instructionCodeTest(){
		String value = LoadFile.returnInstructionCode(8);
		String value2 = LoadFile.returnInstructionCode(10);
		String value3 = LoadFile.returnInstructionCode(12);
		assertEquals("Should be instructionCode", "instructionCode", value);
		assertEquals("Should be instructionCode2", "instructionCode2", value2);
		assertEquals("Should be instructionCode3", "instructionCode3", value3);
	}
	@Test
	public void instructionModuleNameTest(){
		String value = LoadFile.returnInstructionModuleName(8);
		String value2 = LoadFile.returnInstructionModuleName(10);
		String value3 = LoadFile.returnInstructionModuleName(12);
		assertEquals("Should be instructionModule", "instructionModule", value);
		assertEquals("Should be instructionModule2", "instructionModule2", value2);
		assertEquals("Should be instructionModule3", "instructionModule3", value3);
	}
	@Test
	public void instructionLoadAddressTest(){
		Object value = LoadFile.returnInstructionLoadAddress(0);
		Object value2 = LoadFile.returnInstructionLoadAddress(1);
		Object value3 = LoadFile.returnInstructionLoadAddress(2);
		assertEquals("Should be 8.", 8, value);
		assertEquals("Should be 10.", 10, value2);
		assertEquals("Should be 12.", 12, value3);
	}
	@Test
	public void moduleLengthTest(){
		Integer value = LoadFile.returnModuleLength();
		assertEquals(40, 40, value);
	}
	@Test
	public void startAddressTest(){
		Integer value = LoadFile.returnStartAddress();
		assertEquals(0, 0, value);
	}
	@Test
	public void numberOfTextRecordsTest(){
		Integer value = LoadFile.returnNumberOfTextRecords();
		assertEquals(3, 3, value);
	}
	@Test
	public void tresselTest(){
		String value = LoadFile.returnTressel();
		assertEquals("Should be TRESSEL", "TRESSEL", value);
	}
	@Test
	public void versionNumberTest(){
		String value = LoadFile.returnVersion();
		assertEquals("Should be 1.0", "1.0", value);
	}
	@Test
	public void revisionNumberTest(){
		String value = LoadFile.returnRevision();
		assertEquals("Should be 1.0", "1.0", value);
	}
}
